function useTabs<T = string>(option?: {defaultKey?: T}) {
  const tabsKey = ref<T>()

  if (option) {
    if (option.defaultKey !== undefined && option.defaultKey !== null) {
      changeTabsKey(option.defaultKey)
    }
  }

  function changeTabsKey(data: T | undefined) {
    tabsKey.value = data
  }

  return {
    tabsKey,
    changeTabsKey
  }
}

export default useTabs
